<?php
/*
Primary Author: Alex Arey 
Secondary: Derek Shue
Documentation: Cheng Yi
Updated: 12/10/2011
Module Description: The Course Search form allows students, teachers, and administrators to locate courses 
by criteria including Term, Course number, Course name, and Year.
*/

class Application_Form_CourseSearch extends Zend_Form
{

    public function init()
    {
        $this->setMethod('post');
		
	$this->addElement('select','TERM',array(
	    'label' => 'Term:',
	    'MultiOptions' => array('SPRING'=>'Spring','SUMMER'=>'Summer','FALL'=>'Fall'),
		'decorators' =>  array('ViewHelper','Description','Errors',
			array(array('data'=>'HtmlTag'), array('tag' => 'span')),
			array('Label', array('tag' => 'span')),
			array(array('row'=>'HtmlTag'),array('tag'=>'div '))
       		    )
		)
	);			
		
	$this->addElement('text','YEAR',array(
	    'label' => 'Year:',
		'decorators' =>  array('ViewHelper','Description','Errors',
			array(array('data'=>'HtmlTag'), array('tag' => 'span')),
			array('Label', array('tag' => 'span')),
			array(array('row'=>'HtmlTag'),array('tag'=>'div'))
       		    )
		)
	);

	$this->addElement('select','MODIFIER',array(
		'label'=>'Term Matches',
		'MultiOptions'=> array('eq'=>'Exact','lt'=>'Older','gt'=>'Newer', 'yo'=>'Year'),
		'decorators' =>  array('ViewHelper','Description','Errors',
			array(array('data'=>'HtmlTag'), array('tag' => 'span')),
			array('Label', array('tag' => 'span')),
			array(array('row'=>'HtmlTag'),array('tag'=>'div'))
       		    )
		)
	);

	$this->addElement('text','COURSENAME',array(
	    'label' => 'Department Name:',
		'decorators' =>  array('ViewHelper','Description','Errors',
			array(array('data'=>'HtmlTag'), array('tag' => 'span')),
			array('Label', array('tag' => 'span')),
			array(array('row'=>'HtmlTag'),array('tag'=>'div'))
       		    )
		)
	);
	
	$this->addElement('text','COURSENUMBER',array(
	    'label' => 'Course Number:',
		'decorators' =>  array('ViewHelper','Description','Errors',
			array(array('data'=>'HtmlTag'), array('tag' => 'span')),
			array('Label', array('tag' => 'span')),
			array(array('row'=>'HtmlTag'),array('tag'=>'div'))
       		    )
		)
	);
	
	
	$this->addElement('submit','submit',array(
	    'label' => 'Search',
		'decorators' =>array('ViewHelper','Description','Errors',
		array(array('data'=>'HtmlTag'), array('tag' => 'span'))),
		)
	);

        $this->setDecorators(array('FormElements',
		array(array('data'=>'HtmlTag'),array('tag'=>'div')),
		'Form'));
	}


}

